'''
Created on Mar 28, 2012

@author: wilshusensk
'''

from ConstellationWebFinder import insertToTableNonAuto

class oneRow(object):
    def __init__(self, listForRow):
        self.wordsInRow = listForRow
    
    def getWords(self):
        return self.wordsInRow
    
    def addWord(self, newWord):
        self.wordsInRow.append(newWord)
        
    def addListOfWords(self, newWords):
        for word in newWords:
            self.wordsInRow.append(word)
    
    def sortToExoplanetFormat(self):
        print len(self.wordsInRow)
        self.starName = self.wordsInRow[0]
        self.rightAscension = self.wordsInRow[1].split(" ")[0]
        self.declination = self.wordsInRow[2].split(" ")[0]
        print self.declination

    def addSortedRowToDatabase(self, tableName):
        insertToTableNonAuto(tableName, self.starName, "no website", self.declination, self.rightAscension)
